[mirrors]
http://download.oracle.com/berkeley-db/db-5.3.28.tar.gz

[vars]
filesize=35090431
sha512=e91bbe550fc147a8be7e69ade86fdb7066453814971b2b0223f7d17712bd029a8eff5b2b6b238042ff6ec1ffa6879d44cb95c5645a922fee305c26c3eeaee090
desc='library to interface with berkeley (file-based) databases'

[deps]

[build]
patch -p1 < "$K"/bdb-configure.patch
cd build_unix
mv ../config.cache .

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

CFLAGS="-D_GNU_SOURCE" ../dist/configure -C \
    --prefix="$butch_prefix" --enable-compat185 $xconfflags \
    --enable-shared --enable-static --enable-dbm \
    db_cv_clock_monotonic=yes db_cv_build_sequence=yes db_cv_mmap_extend=yes

sed -i 's/^install_docs:/install_docs:\n\ttrue\ninstall_crap:/' Makefile
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
